import { create } from 'zustand'
import { User } from '@/types/api'

export const useStore = create<{
  //   token: string
  userInfo: User.UserItem
  updateUserInfo: (userInfo: User.UserItem) => void
}>(set => ({
  //   token: '',
  userInfo: {
    avatar: '',
    id: 0,
    menus: [],
    role: {},
    ruleNames: [],
    super: 0,
    username: ''
  },
  updateUserInfo: (userInfo: User.UserItem) => set({ userInfo })
}))
